import request from '@/utils/request'

export const searchProducts = (params) => {
    return request({
        url: '/mall-product/product/search',
        method: 'GET',
        params: {
            query: params.query,
            page: params.page,
            size: params.size
        }
    })
}
export const getProductDetail=(id)=>{
    return request({
        url:`/mall-product/product/detail/${id}`,
        method: 'GET'
    })
}
// 获取分类商品列表（分页）
export const getProductListAPI = (categoryId, page = 1, size = 10) => {
    return request({
        url: `/product/listByCategory/${categoryId}`,
        method: 'GET',
        params: {
            page,
            size
        }
    })
}
